weiXinController.controller('kgyLockPageCtl', ['$scope', '$state', '$stateParams', '$timeout', '$interval', '$compile','$rootScope', function ($scope, $state, $stateParams, $timeout, $interval, $compile, $rootScope) {
	/** 获取管理的仓库 */
    $scope.initData = function(){
      EdeyeAdmin.post({
          url: '/warehouse/getHouseByLogin',
      }, {
          SUCCESS: function (ret) {
              $scope.$apply(function () {
                  $scope.list = ret.list;
                  console.log("获取到的仓库数据：", ret.list)
              });
          }
      });
    }
    $scope.initData();

    /** 远程开门 */
    $scope.openDoor = function(id){
        EdeyeAdmin.post({
            url: '/lock_sys/openDoor',
            loadingMaskFlagParam: true,
            data: {'warehouse_id': id}
        }, {
            SUCCESS: function (ret) {
                EdeyeAdmin.closeMsg(ret.msg, true, 1);
            }
        });
    }
}]);